package com.party.admin.biz.webSocket;

import com.party.admin.web.controller.websocket.MyWebSocketHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.socket.TextMessage;

/**
 * @Description: webSocket的业务service
 * @Author: yangshoukun
 * @Date: 2018/3/26 15:54
 */
@Service
public class WebSocketBizService {
    @Autowired
    private MyWebSocketHandler myWebSocketHandler;

    /**
     * 发送消息
     * @param message
     * @param memberId
     */
    public void send(String message, String memberId, String sessionId) {
        TextMessage textMessage = new TextMessage(message);
        myWebSocketHandler.send(textMessage, memberId, sessionId);
    }
}
